//
//  WrongQuesManager.m
//  听说弱点强化训练
//
//  Created by 盛超 on 2018/8/24.
//  Copyright © 2018年 盛超. All rights reserved.
//

#import "LSWrongQuesManager.h"

@implementation LSWrongQuesManager

/*听说题库*/
- (void)requestTSTKWithCompltionSuccess:(void (^)(LSModelTSQues *))success failuer:(void (^)(NSString *))failure {
    
    self.requestUrl = @"api/ZXYYTS/W_ZXYYTS_GetTSTKQue";
    
    [self requestGetMethodWithSuccess:^(id responseObject) {
                
    } Failure:^(NSError *error) {
        
        failure(error.localizedDescription);
        
    }];
}

/*数字化题库*/
- (void)requestSZTKWithCompltionSuccess:(void (^)(LSModelQues *))success failuer:(void (^)(NSString *))failure {
    self.requestUrl = @"api/ZXYYTS/W_ZXYYTS_GetAllSubjectTKQue";
    
    [self requestGetMethodWithSuccess:^(id responseObject) {
        
        NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil];
        //NSLog(@"%@",[NSObject objectToJson:dict]);
        LSModelQues *ques = [LSModelQues yy_modelWithDictionary:dict];
        success(ques);
        
    } Failure:^(NSError *error) {
        
        failure(error.localizedDescription);
        
    }];
    
}

/*错题作答保存接口*/
- (void)requestSaveWrongQuesWithCompltionSuccess:(void (^)(NSString *))success failuer:(void (^)(NSString *))failure {
     self.requestUrl = @"api/ZXYYTS/W_ZXYYTS_SaveWrongQue";
    
    [self requestPostMethodWithSuccess:^(id responseObject) {
        NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil];
        NSLog(@"保存成功success:%@",dict);
        success(@"success");

    } Failure:^(NSError *error) {
        
        failure(error.localizedDescription);

    }];
    
}
@end

@implementation LSModelTSQues


@end
